

import logging, yagmail

# 封装日志采集的方法
def log_set():
    logging.basicConfig(filename='log212.txt', filemode='w+', format='%(asctime)s->%(levelname)s->%(message)s',
                        level=logging.DEBUG)

# 封装发送邮件的方法
def send_mail(filepath):
    mail = yagmail.SMTP(user='774877770@qq.com', password='fjvmkwjdijkfbajg',host='smtp.qq.com')
    mail.send(to='774877770@qq.com', subject='测试报告', contents='今日报告，请查看',attachments=filepath)
